import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:glass_kit/glass_kit.dart';

class BgContainer extends StatefulWidget {
  Widget child;

  BgContainer(this.child, {Key? key}) : super(key: key);

  @override
  _BgContainerState createState() => _BgContainerState();
}

class _BgContainerState extends State<BgContainer> {
  @override
  Widget build(BuildContext context) {
    return Stack(
      children: [
        const BaseBg(),
        GlassContainer.clearGlass(
          height: double.infinity,
          width: double.infinity,
          borderColor: Colors.transparent,
        ),
        SizedBox(
            height: double.infinity,
            width: double.infinity,
            child: widget.child)
      ],
    );
  }
}

class BaseBg extends StatelessWidget {
  const BaseBg({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      decoration: const BoxDecoration(
          gradient: LinearGradient(
              colors: [Color(0XFFD9AFD9), Color(0XFF97D9E1)],
              begin: Alignment.topLeft,
              end: Alignment.bottomRight)),
      height: double.infinity,
      width: double.infinity,
    );
  }
}
